package com.sophialex.health.record.ui.children;

import java.util.ArrayList;
import java.util.List;

import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.DateTime;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Hyperlink;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.ui.part.ViewPart;

import com.sophialex.health.record.Messages;
import com.sophialex.health.record.common.draw.DesignUI;
import com.sophialex.health.record.common.draw.UIFormAttachment;
import com.sophialex.health.record.common.utils.CommonUtils;
import com.sophialex.health.record.common.utils.ImageUtil;

/**
 * 儿童档案登记及第一次检查
 * <p>
 * Title:Health
 * </p>
 * <p>
 * ChildRenRegisterUI
 * </p>
 * Alex May 24, 2011 3:51:27 PM create
 * 
 * @author <a href='wanghao924@126.com'>Alex</a> QQ: 873987060;
 * @version 1.0
 */
public abstract class ChildRenRegisterUI extends ViewPart {
	public static final String ID = "com.sophialex.health.record.ui.children.ChildRenRegisterUI";

	private final FormToolkit toolkit = new FormToolkit(Display.getCurrent());

	private Label lb_name, lb_sex, lb_birthday, lb_jtdh, lb_jtdz, lb_mqxm, lb_mqzy, lb_mqdh, lb_mqsr, lb_fqxm, lb_fqzy, lb_fqdh, lb_fqsr;

	private Label lb_rczs, lb_yqjb, lb_fmdd, lb_fmfs, lb_cstz, lb_tw, lb_hx, lb_mb, lb_ms, lb_ql, lb_hl, lb_yan, lb_sz;

	private Label lb_er, lb_xz, lb_kq, lb_jb, lb_bi, lb_pf, lb_xinz, lb_wszq, lb_fei, lb_kgj, lb_gan, lb_other1, lb_pi, lb_other2, lb_xser, lb_jx, lb_pgr,
			lb_pgsj;

	protected Text txt_name; // 姓名

	protected Combo combo_sex; // 性别

	protected DateTime date_birthday; // 出生日期

	protected Text txt_jtdh; // 家庭电话

	protected Text txt_jtdz; // 家庭地址

	protected Text txt_mqxm; // 母亲姓名

	protected Text txt_mqzy; // 母亲职业

	protected Text txt_mqdh; // 母亲电话

	protected Text txt_mqsr; // 父亲生日

	protected Text txt_fqxm; // 父亲姓名

	protected Text txt_fqzy; // 父亲职业

	protected Text txt_fqdh; // 父亲电话

	protected Text txt_fqsr; // 父亲生日

	protected Text txt_rczs; // 妊娠周数

	protected Text txt_yqjbother; // 孕期疾病其他

	protected Combo combo_fmdd; // 分娩地点

	protected Combo combo_fmfs; // 分娩方式

	protected Text txt_cstz; // 出生体重

	protected Text txt_cssc; // 出生身长

	protected Text txt_cstw; // 出生头围

	protected Combo combo_tw; // 体温

	protected Text txt_tw; // 体温 异常

	protected Combo combo_hx; // 呼吸

	protected Text txt_hx; // 呼吸异常

	protected Combo combo_mb; // 脉搏

	protected Text txt_mb; // 脉搏 异常

	protected Combo combo_ms; // 面色

	protected Text txt_ms; // 面色 异常

	protected Text txt_ql_1; // 前囟 1

	protected Text txt_ql_2; // 前囟 2

	protected Text txt_hl_1; // 后囟 1

	protected Text txt_hl_2; // 后囟 2

	protected Combo combo_yan; // 眼

	protected Text txt_yan; // 眼 异常

	protected Combo combo_sz; // 上肢

	protected Text txt_sz; // 上肢 异常

	protected Combo combo_er; // 耳

	protected Text txt_er; // 耳 异常

	protected Combo combo_xz; // 下肢

	protected Text txt_xz; // 下肢 异常

	protected Combo combo_kq; // 口腔

	protected Text txt_kq; // 口腔 异常

	protected Combo combo_jb; // 颈部

	protected Text txt_jb; // 颈部 异常

	protected Combo combo_bi; // 鼻

	protected Text txt_bi; // 鼻 异常

	protected Combo combo_pf; // 皮肤

	protected Text txt_pf; // 皮肤 异常

	protected Combo combo_xinz; // 心脏

	protected Text txt_xinz; // 心脏 异常

	protected Combo combo_wszq; // 外生殖器

	protected Text txt_wszq; // 外生殖器 异常

	protected Combo combo_fei; // 肺

	protected Text txt_fei; // 肺 异常

	protected Combo combo_kgj; // 髋关节

	protected Text txt_kgj; // 髋关节 异常

	protected Combo combo_gan; // 肝

	protected Text txt_gan; // 肝 异常

	protected Combo combo_other1; // 其他1

	protected Text txt_other1; // 其他1 异常

	protected Combo combo_pi; // 脾

	protected Text txt_pi; // 脾 异常

	protected Combo combo_other2; // 其他2

	protected Text txt_other2; // 其他2 异常

	protected Combo combo_xser; // 新生儿疾病

	protected Text txt_xser; // 新生儿疾病 异常

	protected Combo combo_jx; // 畸形

	protected Text txt_jx; // 畸形 异常

	protected Text txt_pgr; // 评估人

	protected DateTime date_pgsj; // 评估时间

	private Hyperlink chooseChild;

	private Hyperlink chooseMother;

	private Hyperlink chooseFather;

	public ChildRenRegisterUI() {
	}

	private Composite composite_1;

	protected ToolItem toolItemEdit;

	protected ToolItem toolItemDel;

	protected ToolItem toolItemSave;

	protected ToolItem toolItemCancel;

	protected ToolItem toolItemAdd;

	protected ToolItem toolItemExit;

	protected enum ChildRenRegisterState {
		ADD_VIEW, EDIT_VIEW, SHOW_VIEW;
	}

	/**
	 * Create contents of the view part.
	 * 
	 * @param parent
	 */
	@Override
	public void createPartControl(Composite parent) {
		Composite container = new Composite(parent, SWT.NONE);
		container.setLayout(new FormLayout());
		{
			composite_1 = new Composite(container, SWT.NONE);
			composite_1.setLayout(new FillLayout(SWT.HORIZONTAL));
			{
				FormData formData = new FormData();
				formData.height = 50;
				formData.right = new FormAttachment(100);
				formData.top = new FormAttachment(0);
				formData.left = new FormAttachment(0);
				composite_1.setLayoutData(formData);
			}
			{
				ToolBar toolBar = new ToolBar(composite_1, SWT.FLAT | SWT.NONE);
				toolBar.setBackgroundImage(ImageUtil.TBBJ);
				// {
				// toolItemAdd = new ToolItem(toolBar, SWT.NONE);
				//					toolItemAdd.setText(Messages.getString("RecordUI.0")); //$NON-NLS-1$
				// toolItemAdd.setImage(ImageUtil.add);
				// toolItemAdd.addSelectionListener(new SelectionAdapter() {
				// @Override
				// public void widgetSelected(SelectionEvent e) {
				// doAdd();
				// }
				// });
				// }
				{
					toolItemEdit = new ToolItem(toolBar, SWT.NONE);
					toolItemEdit.setText(Messages.getString("RecordUI.1")); //$NON-NLS-1$
					toolItemEdit.setImage(ImageUtil.edit);
					toolItemEdit.addSelectionListener(new SelectionAdapter() {
						@Override
						public void widgetSelected(SelectionEvent e) {
							doEdit();
						}
					});
				}
				{
					toolItemDel = new ToolItem(toolBar, SWT.NONE);
					toolItemDel.setText(Messages.getString("RecordUI.2")); //$NON-NLS-1$
					toolItemDel.setImage(ImageUtil.delete);
					toolItemDel.addSelectionListener(new SelectionAdapter() {
						@Override
						public void widgetSelected(SelectionEvent e) {
							doDel();
						}
					});
				}
				{
					@SuppressWarnings("unused")
					ToolItem toolItem = new ToolItem(toolBar, SWT.SEPARATOR);
				}
				{
					toolItemSave = new ToolItem(toolBar, SWT.NONE);
					toolItemSave.setText(Messages.getString("RecordUI.3")); //$NON-NLS-1$
					toolItemSave.addSelectionListener(new SelectionAdapter() {
						@Override
						public void widgetSelected(SelectionEvent e) {
							doSave();
						}
					});
					toolItemSave.setImage(ImageUtil.save);
				}

				{
					toolItemCancel = new ToolItem(toolBar, SWT.NONE);
					toolItemCancel.setText(Messages.getString("RecordUI.4")); //$NON-NLS-1$
					toolItemCancel.addSelectionListener(new SelectionAdapter() {
						@Override
						public void widgetSelected(SelectionEvent e) {
							doCancel();
						}
					});
					toolItemCancel.setImage(ImageUtil.cancel);
				}
				{
					toolItemExit = new ToolItem(toolBar, SWT.NONE);
					toolItemExit.setText(Messages.getString("RecordUI.6")); //$NON-NLS-1$
					toolItemExit.addSelectionListener(new SelectionAdapter() {
						@Override
						public void widgetSelected(SelectionEvent e) {
							doExit();
						}
					});
					toolItemExit.setImage(ImageUtil.exit);
				}
				/*
				 * { ToolItem toolItem = new ToolItem(toolBar, SWT.NONE);
				 * toolItem.setText(Messages.getString("RecordUI.5"));
				 * //$NON-NLS-1$ toolItem.setImage(ImageUtil.print);
				 * toolItem.addSelectionListener(new SelectionAdapter() {
				 * 
				 * @Override public void widgetSelected(SelectionEvent e) {
				 * doPrint(); } }); }
				 */
			}
		}

		{
			Composite composite = new Composite(container, SWT.NONE);
			{
				FormData formData = new FormData();
				formData.top = new FormAttachment(composite_1, 0);
				formData.bottom = new FormAttachment(100, -4);
				formData.right = new FormAttachment(composite_1, 0, SWT.RIGHT);
				formData.left = new FormAttachment(composite_1, 0, SWT.LEFT);
				composite.setLayout(new FillLayout(SWT.FILL));
				composite.setLayoutData(formData);

			}
			drawUI(composite);
		}
		initCombo();
		createActions();
		initializeToolBar();
		initializeMenu();

		this.setPartName(Messages.getString("ChildRenRegister.Title")); //$NON-NLS-1$

	}

	// 绘制界面
	private void drawUI(Composite parent) {

		ScrolledComposite scrolledComposite = new ScrolledComposite(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
		toolkit.adapt(scrolledComposite);
		toolkit.paintBordersFor(scrolledComposite);
		scrolledComposite.setExpandHorizontal(true);
		scrolledComposite.setExpandVertical(true);

		ScrolledForm scrldfrmNewScrolledform = toolkit.createScrolledForm(scrolledComposite);
		toolkit.paintBordersFor(scrldfrmNewScrolledform);
		scrldfrmNewScrolledform.setText("   姓名：张三             个人档案编号：152877552142211");
		scrldfrmNewScrolledform.getBody().setLayout(new FormLayout());

		// 基本信息
		UIFormAttachment fzjcsectionUIAttachment = UIFormAttachment.getDefault(12);
		Section jbxxSection = DesignUI.drawSection(toolkit, scrldfrmNewScrolledform, fzjcsectionUIAttachment, "基本信息", false);
		Composite composite_jbxx = DesignUI.drawSectionComposite(toolkit, jbxxSection);

		List<Control[]> jbxxcontrolList = new ArrayList<Control[]>();
		// 姓名
		{
			lb_name = toolkit.createLabel(composite_jbxx, "    姓名：", SWT.NONE);
			txt_name = toolkit.createText(composite_jbxx, "", SWT.NONE);
			chooseChild = toolkit.createHyperlink(composite_jbxx, "选择", SWT.NONE);
			chooseChild.setToolTipText("选择儿童");
			Control[] controls = { lb_name, txt_name, chooseChild };
			jbxxcontrolList.add(controls);
		}
		// 性别
		{
			lb_sex = toolkit.createLabel(composite_jbxx, "  性别：", SWT.NONE);
			combo_sex = new Combo(composite_jbxx, SWT.READ_ONLY);
			Control[] controls = { lb_sex, combo_sex };
			jbxxcontrolList.add(controls);
		}
		// 出生日期
		{
			lb_birthday = toolkit.createLabel(composite_jbxx, "出生日期：", SWT.NONE);
			date_birthday = new DateTime(composite_jbxx, SWT.BORDER | SWT.DROP_DOWN);
			Control[] controls = { lb_birthday, date_birthday };
			jbxxcontrolList.add(controls);
		}
		// 家庭电话
		{
			lb_jtdh = toolkit.createLabel(composite_jbxx, "家庭电话：", SWT.NONE);
			txt_jtdh = toolkit.createText(composite_jbxx, "", SWT.NONE);
			Control[] controls = { lb_jtdh, txt_jtdh };
			jbxxcontrolList.add(controls);
		}
		DesignUI.drawSecionContent(composite_jbxx, jbxxcontrolList, 4, true, null);

		// 家庭地址
		{
			lb_jtdz = toolkit.createLabel(composite_jbxx, "家庭地址：", SWT.NONE);
			txt_jtdz = toolkit.createText(composite_jbxx, "", SWT.NONE);
			Control[] controls = { lb_jtdz, txt_jtdz };
			DesignUI.drawItem(composite_jbxx, controls, true, true, lb_jtdh, combo_sex);
		}
		List<Control[]> jbxxcontrolList2 = new ArrayList<Control[]>();
		// 母亲姓名
		{
			lb_mqxm = toolkit.createLabel(composite_jbxx, "母亲姓名：", SWT.NONE);
			txt_mqxm = toolkit.createText(composite_jbxx, "", SWT.NONE);
			chooseMother = toolkit.createHyperlink(composite_jbxx, "选择", SWT.NONE);
			chooseMother.setToolTipText("选择母亲");
			Control[] controls = { lb_mqxm, txt_mqxm, chooseMother };
			jbxxcontrolList2.add(controls);
		}
		// 母亲职业
		{
			lb_mqzy = toolkit.createLabel(composite_jbxx, "  职业：", SWT.NONE);
			txt_mqzy = toolkit.createText(composite_jbxx, "", SWT.NONE);
			Control[] controls = { lb_mqzy, txt_mqzy };
			jbxxcontrolList2.add(controls);
		}
		// 母亲电话
		{
			lb_mqdh = toolkit.createLabel(composite_jbxx, "    电话：", SWT.NONE);
			txt_mqdh = toolkit.createText(composite_jbxx, "", SWT.NONE);
			Control[] controls = { lb_mqdh, txt_mqdh };
			jbxxcontrolList2.add(controls);
		}
		// 母亲生日
		{
			lb_mqsr = toolkit.createLabel(composite_jbxx, "    出生：", SWT.NONE);
			txt_mqsr = toolkit.createText(composite_jbxx, "", SWT.NONE);
			Control[] controls = { lb_mqsr, txt_mqsr };
			jbxxcontrolList2.add(controls);
		}

		// 父亲姓名
		{
			lb_fqxm = toolkit.createLabel(composite_jbxx, "父亲姓名：", SWT.NONE);
			txt_fqxm = toolkit.createText(composite_jbxx, "", SWT.NONE);
			chooseFather = toolkit.createHyperlink(composite_jbxx, "选择", SWT.NONE);
			chooseFather.setToolTipText("选择父亲");
			Control[] controls = { lb_fqxm, txt_fqxm, chooseFather };
			jbxxcontrolList2.add(controls);
		}
		// 父亲职业
		{
			lb_fqzy = toolkit.createLabel(composite_jbxx, "  职业：", SWT.NONE);
			txt_fqzy = toolkit.createText(composite_jbxx, "", SWT.NONE);
			Control[] controls = { lb_fqzy, txt_fqzy };
			jbxxcontrolList2.add(controls);
		}
		// 父亲电话
		{
			lb_fqdh = toolkit.createLabel(composite_jbxx, "    电话：", SWT.NONE);
			txt_fqdh = toolkit.createText(composite_jbxx, "", SWT.NONE);
			Control[] controls = { lb_fqdh, txt_fqdh };
			jbxxcontrolList2.add(controls);
		}
		// 父亲生日
		{
			lb_fqsr = toolkit.createLabel(composite_jbxx, "    出生：", SWT.NONE);
			txt_fqsr = toolkit.createText(composite_jbxx, "", SWT.NONE);
			Control[] controls = { lb_fqsr, txt_fqsr };
			jbxxcontrolList2.add(controls);
		}
		DesignUI.drawSecionContent(composite_jbxx, jbxxcontrolList2, 4, false, lb_jtdz);
		// 妊娠周数
		{
			lb_rczs = toolkit.createLabel(composite_jbxx, "妊娠周数：", SWT.NONE);
			txt_rczs = toolkit.createText(composite_jbxx, "", SWT.NONE);
			Label lb_zou = toolkit.createLabel(composite_jbxx, "周", SWT.NONE);
			Control[] controls = { lb_rczs, txt_rczs, lb_zou };
			DesignUI.drawItem(composite_jbxx, controls, false, true, lb_fqxm);
		}
		// 孕期疾病
		{
			lb_yqjb = toolkit.createLabel(composite_jbxx, "孕期疾病：", SWT.NONE);
			FormData fd_yqjb = new FormData();
			fd_yqjb.right = new FormAttachment(lb_fqzy, 0, SWT.RIGHT);
			fd_yqjb.bottom = new FormAttachment(lb_rczs, 0, SWT.BOTTOM);
			lb_yqjb.setLayoutData(fd_yqjb);

			Button[] zzButtons = CommonUtils.initCheckBoxUI(toolkit, composite_jbxx, lb_yqjb, "YQJB", new int[] { 15 }, null, "drinkWater");

			{
				txt_yqjbother = toolkit.createText(composite_jbxx, "", SWT.NONE);
				FormData fd_yqjbother = new FormData();
				fd_yqjbother.top = new FormAttachment(txt_rczs, 0, SWT.TOP);
				fd_yqjbother.right = new FormAttachment(txt_fqdh, 0, SWT.RIGHT);
				fd_yqjbother.bottom = new FormAttachment(lb_yqjb, 0, SWT.BOTTOM);
				fd_yqjbother.left = new FormAttachment(zzButtons[zzButtons.length - 1]);
				txt_yqjbother.setLayoutData(fd_yqjbother);

			}
		}
		List<Control[]> oneLine = new ArrayList<Control[]>();
		// 分娩地点
		{
			lb_fmdd = toolkit.createLabel(composite_jbxx, "分娩地点：", SWT.NONE);
			combo_fmdd = new Combo(composite_jbxx, SWT.READ_ONLY);
			Control[] controls = { lb_fmdd, combo_fmdd };
			oneLine.add(controls);
		}
		// 分娩方式
		{
			lb_fmfs = toolkit.createLabel(composite_jbxx, "分娩方式：", SWT.NONE);
			combo_fmfs = new Combo(composite_jbxx, SWT.READ_ONLY);
			Control[] controls = { lb_fmfs, combo_fmfs };
			oneLine.add(controls);
		}
		Control[] refer_one = { lb_rczs, lb_yqjb };
		DesignUI.drawRow(composite_jbxx, oneLine, refer_one, false);
		// 出生体重 / 身长 / 头围
		{
			lb_cstz = toolkit.createLabel(composite_jbxx, "出生情况（体重/身长/头围）：", SWT.NONE);
			txt_cstz = toolkit.createText(composite_jbxx, "", SWT.NONE);
			txt_cssc = toolkit.createText(composite_jbxx, "", SWT.NONE);
			txt_cstw = toolkit.createText(composite_jbxx, "", SWT.NONE);
			Label lb_xg = toolkit.createLabel(composite_jbxx, "/", SWT.NONE);
			Label lb_xg1 = toolkit.createLabel(composite_jbxx, "/", SWT.NONE);
			Label lb_g = toolkit.createLabel(composite_jbxx, "g", SWT.NONE);
			Label lb_cm = toolkit.createLabel(composite_jbxx, "cm", SWT.NONE);
			Label lb_cm1 = toolkit.createLabel(composite_jbxx, "cm", SWT.NONE);
			Control[] controls = { lb_cstz, txt_cstz, lb_xg, txt_cssc, lb_xg1, txt_cstw };
			DesignUI.drawItem(composite_jbxx, controls, false, false, combo_fmfs, 80);
			DesignUI.drawAddTo(txt_cstz, lb_g, 2);
			DesignUI.drawAddTo(txt_cssc, lb_cm, 2);
			DesignUI.drawAddTo(txt_cstw, lb_cm1, 2);
		}

		// 检查信息
		UIFormAttachment jcxxsectionUIAttachment = UIFormAttachment.getDefault(jbxxSection, 20, 0, false);
		Section jcxxSection = DesignUI.drawSection(toolkit, scrldfrmNewScrolledform, jcxxsectionUIAttachment, "检查信息", true);
		Composite composite_jcxx = DesignUI.drawSectionComposite(toolkit, jcxxSection);
		List<Control[]> jcxxcontrolList = new ArrayList<Control[]>();
		// 体温
		{
			lb_tw = toolkit.createLabel(composite_jcxx, "    体温：", SWT.NONE);
			combo_tw = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_rczs = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_tw, combo_tw, txt_rczs };
			jcxxcontrolList.add(controls);
		}
		// 呼吸
		{
			lb_hx = toolkit.createLabel(composite_jcxx, "呼吸：", SWT.NONE);
			combo_hx = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_hx = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_hx, combo_hx, txt_hx };
			jcxxcontrolList.add(controls);
		}
		// 脉搏
		{
			lb_mb = toolkit.createLabel(composite_jcxx, "脉搏：", SWT.NONE);
			combo_mb = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_mb = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_mb, combo_mb, txt_mb };
			jcxxcontrolList.add(controls);
		}
		// 面色
		{
			lb_ms = toolkit.createLabel(composite_jcxx, "面色：", SWT.NONE);
			combo_ms = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_ms = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_ms, combo_ms, txt_ms };
			jcxxcontrolList.add(controls);
		}
		DesignUI.defaultWidth = 86;
		DesignUI.drawSecionContent(composite_jcxx, jcxxcontrolList, 4, true, null);
		DesignUI.reset();
		List<Control[]> jcxxTwoLine = new ArrayList<Control[]>();
		// 前囟
		{
			lb_ql = toolkit.createLabel(composite_jcxx, "前囟：", SWT.NONE);
			txt_ql_1 = toolkit.createText(composite_jcxx, "", SWT.NONE);
			txt_ql_2 = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_ql, txt_ql_1, txt_ql_2 };
			jcxxTwoLine.add(controls);
		}
		// 后囟
		{
			lb_hl = toolkit.createLabel(composite_jcxx, "后囟：", SWT.NONE);
			txt_hl_1 = toolkit.createText(composite_jcxx, "", SWT.NONE);
			txt_hl_2 = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_hl, txt_hl_1, txt_hl_2 };
			jcxxTwoLine.add(controls);
		}
		Label lb_qx = toolkit.createLabel(composite_jcxx, "cm×", SWT.NONE);
		Label lb_hx = toolkit.createLabel(composite_jcxx, "cm×", SWT.NONE);
		DesignUI.wightmargin = 35;
		DesignUI.defaultWidth = 70;
		DesignUI.drawRow(composite_jcxx, jcxxTwoLine, lb_tw, false, true);
		DesignUI.drawAddTo(txt_ql_1, lb_qx, 2);
		DesignUI.drawAddTo(txt_hl_1, lb_hx, 2);
		DesignUI.reset();

		// 眼
		{
			lb_yan = toolkit.createLabel(composite_jcxx, "  眼：", SWT.NONE);
			combo_yan = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_yan = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_yan, combo_yan, txt_yan };
			DesignUI.defaultWidth = 86;
			DesignUI.drawItem(composite_jcxx, controls, false, false, txt_hl_2);
			DesignUI.reset();
		}
		// 上肢
		{
			lb_sz = toolkit.createLabel(composite_jcxx, "上肢：", SWT.NONE);
			combo_sz = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_sz = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_sz, combo_sz, txt_sz };
			DesignUI.defaultWidth = 86;
			DesignUI.drawItem(composite_jcxx, controls, false, false, txt_yan);
			DesignUI.reset();
		}

		List<Control[]> jcxxThreeLine = new ArrayList<Control[]>();
		// 耳
		{
			lb_er = toolkit.createLabel(composite_jcxx, "      耳：", SWT.NONE);
			combo_er = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_er = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_er, combo_er, txt_er };
			jcxxThreeLine.add(controls);
		}
		// 下肢
		{
			lb_xz = toolkit.createLabel(composite_jcxx, "下肢：", SWT.NONE);
			combo_xz = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_xz = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_xz, combo_xz, txt_xz };
			jcxxThreeLine.add(controls);
		}
		// 口腔
		{
			lb_kq = toolkit.createLabel(composite_jcxx, "口腔：", SWT.NONE);
			combo_kq = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_kq = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_kq, combo_kq, txt_kq };
			jcxxThreeLine.add(controls);
		}
		// 颈部
		{
			lb_jb = toolkit.createLabel(composite_jcxx, "颈部：", SWT.NONE);
			combo_jb = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_jb = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_jb, combo_jb, txt_jb };
			jcxxThreeLine.add(controls);
		}
		// 鼻
		{
			lb_bi = toolkit.createLabel(composite_jcxx, "鼻：", SWT.NONE);
			combo_bi = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_bi = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_bi, combo_bi, txt_bi };
			jcxxThreeLine.add(controls);
		}
		// 皮肤
		{
			lb_pf = toolkit.createLabel(composite_jcxx, "皮肤：", SWT.NONE);
			combo_pf = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_pf = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_pf, combo_pf, txt_pf };
			jcxxThreeLine.add(controls);
		}
		// 心脏
		{
			lb_xinz = toolkit.createLabel(composite_jcxx, "心脏：", SWT.NONE);
			combo_xinz = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_xinz = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_xinz, combo_xinz, txt_xinz };
			jcxxThreeLine.add(controls);
		}
		// 外生殖器
		{
			lb_wszq = toolkit.createLabel(composite_jcxx, "外生殖器：", SWT.NONE);
			combo_wszq = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_wszq = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_wszq, combo_wszq, txt_wszq };
			jcxxThreeLine.add(controls);
		}
		// 肺
		{
			lb_fei = toolkit.createLabel(composite_jcxx, "肺：", SWT.NONE);
			combo_fei = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_fei = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_fei, combo_fei, txt_fei };
			jcxxThreeLine.add(controls);
		}
		// 髋关节
		{
			lb_kgj = toolkit.createLabel(composite_jcxx, "髋关节：", SWT.NONE);
			combo_kgj = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_kgj = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_kgj, combo_kgj, txt_kgj };
			jcxxThreeLine.add(controls);
		}
		// 肝
		{
			lb_gan = toolkit.createLabel(composite_jcxx, "肝：", SWT.NONE);
			combo_gan = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_gan = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_gan, combo_gan, txt_gan };
			jcxxThreeLine.add(controls);
		}
		// 其他1
		{
			lb_other1 = toolkit.createLabel(composite_jcxx, "其他：", SWT.NONE);
			combo_other1 = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_other1 = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_other1, combo_other1, txt_other1 };
			jcxxThreeLine.add(controls);
		}
		// 脾
		{
			lb_pi = toolkit.createLabel(composite_jcxx, "脾：", SWT.NONE);
			combo_pi = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_pi = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_pi, combo_pi, txt_pi };
			jcxxThreeLine.add(controls);
		}
		// 其他2
		{
			lb_other2 = toolkit.createLabel(composite_jcxx, "其他：", SWT.NONE);
			combo_other2 = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_other2 = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_other2, combo_other2, txt_other2 };
			jcxxThreeLine.add(controls);
		}
		// 新生儿疾病
		{
			lb_xser = toolkit.createLabel(composite_jcxx, "新生儿疾病：", SWT.NONE);
			combo_xser = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_xser = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_xser, combo_xser, txt_xser };
			jcxxThreeLine.add(controls);
		}
		// 畸形
		{
			lb_jx = toolkit.createLabel(composite_jcxx, "畸形：", SWT.NONE);
			combo_jx = new Combo(composite_jcxx, SWT.READ_ONLY);
			txt_jx = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_jx, combo_jx, txt_jx };
			jcxxThreeLine.add(controls);
		}
		DesignUI.defaultWidth = 86;
		DesignUI.drawSecionContent(composite_jcxx, jcxxThreeLine, 4, true, lb_ql);
		DesignUI.reset();

		List<Control[]> lastLine = new ArrayList<Control[]>();
		// 评估人
		{
			lb_pgr = toolkit.createLabel(composite_jcxx, "评估人：", SWT.NONE);
			txt_pgr = toolkit.createText(composite_jcxx, "", SWT.NONE);
			Control[] controls = { lb_pgr, txt_pgr };
			lastLine.add(controls);
		}
		// 评估时间
		{
			lb_pgsj = toolkit.createLabel(composite_jcxx, "评估时间：", SWT.NONE);
			date_pgsj = new DateTime(composite_jcxx, SWT.BORDER | SWT.DROP_DOWN);
			Control[] controls = { lb_pgsj, date_pgsj };
			toolkit.adapt(date_pgsj, true, true);
			lastLine.add(controls);
		}

		Control[] refer_last = { lb_pi, lb_other2 };
		DesignUI.drawRow(composite_jcxx, lastLine, refer_last, false);
		scrolledComposite.setContent(scrldfrmNewScrolledform);
		scrolledComposite.setMinSize(scrldfrmNewScrolledform.computeSize(SWT.DEFAULT, SWT.DEFAULT));

	}

	protected void doExport() {

	}

	protected void doExit() {
		getViewSite().getPage().hideView(this);
	}

	protected abstract void doCancel();

	protected abstract void doSave();

	protected abstract void doDel();

	protected abstract void doEdit();

	protected abstract void doAdd();

	protected abstract void doPrint();

	/**
	 * Create the actions.
	 */
	private void createActions() {

	}

	/**
	 * Initialize the toolbar.
	 */
	private void initializeToolBar() {
		@SuppressWarnings("unused")
		IToolBarManager toolbarManager = getViewSite().getActionBars().getToolBarManager();
	}

	/**
	 * Initialize the menu.
	 */
	private void initializeMenu() {
		@SuppressWarnings("unused")
		IMenuManager menuManager = getViewSite().getActionBars().getMenuManager();
	}

	public void initCombo() {
		CommonUtils.initCombo(combo_sex, "SEX");
		CommonUtils.initCombo(combo_fmdd, "FMDD");
		CommonUtils.initCombo(combo_fmfs, "FMFS");
		CommonUtils.initCombo(combo_tw, "ZCYC");
		CommonUtils.initCombo(combo_hx, "ZCYC");
		CommonUtils.initCombo(combo_mb, "ZCYC");
		CommonUtils.initCombo(combo_ms, "ZCYC");
		CommonUtils.initCombo(combo_yan, "ZCYC");
		CommonUtils.initCombo(combo_sz, "ZCYC");
		CommonUtils.initCombo(combo_er, "ZCYC");
		CommonUtils.initCombo(combo_xz, "ZCYC");

		CommonUtils.initCombo(combo_kq, "ZCYC");
		CommonUtils.initCombo(combo_jb, "ZCYC");
		CommonUtils.initCombo(combo_bi, "ZCYC");
		CommonUtils.initCombo(combo_pf, "ZCYC");

		CommonUtils.initCombo(combo_xinz, "ZCYC");
		CommonUtils.initCombo(combo_wszq, "ZCYC");
		CommonUtils.initCombo(combo_kgj, "ZCYC");
		CommonUtils.initCombo(combo_fei, "ZCYC");
		CommonUtils.initCombo(combo_other1, "ZCYC");

		CommonUtils.initCombo(combo_gan, "ZCYC");
		CommonUtils.initCombo(combo_pi, "ZCYC");
		CommonUtils.initCombo(combo_other2, "ZCYC");

		CommonUtils.initCombo(combo_xser, "YOUWU");
		CommonUtils.initCombo(combo_jx, "YOUWU");

	}

}
